load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test")

go_library(
    name = "kvstorage",
    srcs = [
        "cluster_version.go",
        "destroy.go",
        "doc.go",
        "init.go",
        "replica_state.go",
    ],
    importpath = "github.com/cockroachdb/cockroach/pkg/kv/kvserver/kvstorage",
    visibility = ["//visibility:public"],
    deps = [
        "//pkg/clusterversion",
        "//pkg/keys",
        "//pkg/kv/kvpb",
        "//pkg/kv/kvserver/kvserverpb",
        "//pkg/kv/kvserver/logstore",
        "//pkg/kv/kvserver/rditer",
        "//pkg/kv/kvserver/stateloader",
        "//pkg/raft/raftpb",
        "//pkg/roachpb",
        "//pkg/storage",
        "//pkg/storage/enginepb",
        "//pkg/util/buildutil",
        "//pkg/util/hlc",
        "//pkg/util/iterutil",
        "//pkg/util/log",
        "//pkg/util/protoutil",
        "//pkg/util/timeutil",
        "@com_github_cockroachdb_errors//:errors",
    ],
)

go_test(
    name = "kvstorage_test",
    srcs = [
        "cluster_version_test.go",
        "datadriven_test.go",
    ],
    data = glob(["testdata/**"]),
    embed = [":kvstorage"],
    deps = [
        "//pkg/clusterversion",
        "//pkg/keys",
        "//pkg/kv/kvserver/logstore",
        "//pkg/raft/raftpb",
        "//pkg/roachpb",
        "//pkg/settings/cluster",
        "//pkg/storage",
        "//pkg/testutils",
        "//pkg/testutils/datapathutils",
        "//pkg/util/hlc",
        "//pkg/util/leaktest",
        "//pkg/util/log",
        "//pkg/util/stop",
        "//pkg/util/tracing",
        "//pkg/util/uuid",
        "@com_github_cockroachdb_datadriven//:datadriven",
        "@com_github_stretchr_testify//require",
    ],
)
